<%@page import="util.Constants" %>
<%
    String logID;
    String title, description, product, corrective;
    String projectID, priorityID, severityID, statusID, typeID;
    String defectedByID, assignedByID, fixedByID;
    String createdDate_date, createdDate_month, createdDate_year;
    String deadline_date, deadline_month, deadline_year;
    String fixedDate_date, fixedDate_month, fixedDate_year;
    String closedDate_date, closedDate_month, closedDate_year;

    logID = (String) session.getAttribute("defectLogID");
    title = (String) session.getAttribute("title");
    description = (String) session.getAttribute("description");
    product = (String) session.getAttribute("product");
    corrective = (String) session.getAttribute("correctiveAction");
    projectID = (String) session.getAttribute("projectID");
    priorityID = (String) session.getAttribute("priorityID");
    severityID = (String) session.getAttribute("severityID");
    statusID = (String) session.getAttribute("statusID");
    typeID = (String) session.getAttribute("typeID");
    defectedByID = (String) session.getAttribute("defectedByID");
    assignedByID = (String) session.getAttribute("assignedToID");
    fixedByID = (String) session.getAttribute("fixedByID");
    createdDate_date = (String) session.getAttribute("createdDate_date");
    createdDate_month = (String) session.getAttribute("createdDate_month");
    createdDate_year = (String) session.getAttribute("createdDate_year");
    deadline_date = (String) session.getAttribute("deadline_date");
    deadline_month = (String) session.getAttribute("deadline_month");
    deadline_year = (String) session.getAttribute("deadline_year");
    fixedDate_date = (String) session.getAttribute("fixedDate_date");
    fixedDate_month = (String) session.getAttribute("fixedDate_month");
    fixedDate_year = (String) session.getAttribute("fixedDate_year");
    closedDate_date = (String) session.getAttribute("closedDate_date");
    closedDate_month = (String) session.getAttribute("closedDate_month");
    closedDate_year = (String) session.getAttribute("closedDate_year");
%>
<input type="hidden" name="selectedItemID" value=""/>
<div style="width: 45%; float: left; margin-left: 30px;">
    <span class="label">Project</span>
    <select type="select" class="value" id="cbxProjectId" name="cbxProjectId">
        <%
            controller.defectLogController.loadProjectData(out, projectID);
        %>
    </select><div class="clear"></div>
    <input type="hidden" name="logID" value="<%=logID%>"/>

    <span class="label">Title</span>
    <input type="text" id="txtTitle" name="txtTitle" size="40" value="<%=title%>"/><div class="clear"></div>

    <span class="label">Description</span>
    <input type="text" name="txtDescription" size="40" value="<%=description%>"/><div class="clear"></div>

    <span class="label">Created Date</span>
    <select name="txtCreate_date" style="width: 50px;">
        <% util.StringDate.insertDateBoxValue(out, createdDate_date);%></select>
    <select name="txtCreate_month" style="width: 50px;">
        <% util.StringDate.insertMonthBoxValue(out, createdDate_month);%></select>
    <select name="txtCreate_year" style="width: 100px;">
        <% util.StringDate.insertYearBoxValue(out, closedDate_year);%></select>
    <div class="clear"></div>

    <span class="label">Status</span>
    <select size="1" name="cbxStatus">
        <%
            controller.defectLogController.loadStatusData(out, statusID);
        %>
    </select><div class="clear"></div>

    <span class="label">Product</span>
    <input type="text" name="txtProduct" size="40" value="<%=title%>"/><div class="clear"></div>

    <span class="label">Severity</span>
    <select size="1" name="cbxSeverity">
        <%
            controller.defectLogController.loadSeverityData(out, severityID);
        %>	
    </select><div class="clear"></div>

    <span class="label">Priority</span>
    <select size="1" name="cbxPriority">
        <%
            controller.defectLogController.loadPriorityData(out, priorityID);
        %>	
    </select><div class="clear"></div>
</div>
<div style="width: 45%; float: left; margin-left: 30px;">
    <span class="label">Log Type</span>
    <select size="1" name="cbxLogType">
        <%
            controller.defectLogController.loadLogtypeData(out, typeID);
        %>	
    </select><div class="clear"></div>

    <span class="label">Defected By</span>
    <select size="1" name="cbxDefectBy">
        <%
            controller.defectLogController.loadEmployeeData(out, defectedByID);
        %>	
    </select><div class="clear"></div>

    <span class="label">Assigned To</span>
    <select size="1" name="cbxAssignTo">
        <%
            controller.defectLogController.loadEmployeeData(out, assignedByID);
        %>	
    </select><div class="clear"></div>

    <span class="label">Deadline</span>
    <select name="txtDeadline_date" style="width: 50px;"><% util.StringDate.insertDateBoxValue(out, deadline_date);%></select>
    <select name="txtDeadline_month" style="width: 50px;"><% util.StringDate.insertMonthBoxValue(out, deadline_month);%></select>
    <select name="txtDeadline_year" style="width: 100px;"><% util.StringDate.insertYearBoxValue(out, deadline_year);%></select>
    <div class="clear"></div>

    <span class="label">Corrective Action</span>
    <input type="text" name="txtCorrective" size="40" value="<%=corrective%>"/><div class="clear"></div>

    <span class="label">Fixed By</span>
    <select size="1" name="cbxFixedBy">
        <%
            controller.defectLogController.loadEmployeeData(out, fixedByID);
        %>	
    </select><div class="clear"></div>

    <span class="label">Fixed Date</span>
    <select name="txtFixedDate_date" style="width: 50px;">
        <% util.StringDate.insertDateBoxValue(out, fixedDate_date);%></select>
    <select name="txtFixedDate_month" style="width: 50px;">
        <% util.StringDate.insertMonthBoxValue(out, fixedDate_month);%></select>
    <select name="txtFixedDate_year" style="width: 100px;">
        <% util.StringDate.insertYearBoxValue(out, fixedDate_year);%></select>
    <div class="clear"></div>

    <span class="label">Closed Date</span>
    <select name="txtClosedDate_date" style="width: 50px;">
        <% util.StringDate.insertDateBoxValue(out, closedDate_date);%></select>
    <select name="txtClosedDate_month" style="width: 50px;">
        <% util.StringDate.insertMonthBoxValue(out, closedDate_month);%></select>
    <select name="txtClosedDate_year" style="width: 100px;">
        <% util.StringDate.insertYearBoxValue(out, closedDate_year);%></select>
    <div class="clear"></div>
</div>

<div class="clear"></div>
<br></br>
   <a style="margin: 0px auto;" class="button" onclick="doAction(frmIndex,'<%=Constants.DEFECT_LOG_PAGE_NAME%>',
    '<%=Constants.DEFECTLOG_LIST%>','<%=Constants.DEFECTLOG_LIST%>','<%=Constants.EDIT%>')">
    Save
</a>